import pojo.*;

import java.util.Scanner;

public class main {
    public static void main(String[] args)  {
        User u=login();
        CommodityList commodityList=new CommodityList();
        while (true){
            int menu=u.menu();
            u.doWork(menu,commodityList);
        }
    }

    public static User login() {
        System.out.println("输入你的名字");
        Scanner sc = new Scanner(System.in);
        String name1 = sc.nextLine();
        System.out.println("选择你的身份<—1.管理员——<—2.普通用户");
        int i = sc.nextInt();
        if ((i == 1)) {
            return new AdminUser(name1);
        }else if (i == 2) {
            return new NormalUser(name1);

        }else
        return null;
    }
}
